home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / vidhandl / xmkline.c < prev   
Text File  |  1999-02-03  |  2KB  |  75 lines

  1. //mkline_mat4 is the enhanced version of mkline_mat
  2. //mkline_aux4 is the enhanced version of mkline_aux
  3. //mkline4 is the enhanced version of mkline
  4.  
  5. char const mkline_mat4[]="\
  6.  Çü─ éâ═ êëè \1\2\3\
  7. ä┌┐┬ä╒╕╤äïîìä\4\5\6\
  8. à└┘┴à╘╛╧àÄÅÉà\a\b\t\
  9. │├┤┼│╞╡╪│æÆô│\n\13\14\
  10.  Çü─ éâ═ êëè \1\2\3\
  11. å╓╖╥å╔╗╦åöòûå\15\16\17\
  12. ç╙╜╨ç╚╝╩çùÿÖç\20\21\22\
  13. ║╟╢╫║╠╣╬║Ü¢£║\23\24\25\
  14.  Çü─ éâ═ êëè \1\2\3\
  15. ¥₧ƒá¥⌐¬½¥πΣσ¥\26\27\30\
  16. íóúñí¼¡«íµτΦí\31\32\33\
  17. Ѫº¿ÑαßΓÑΘΩδÑ\34\35\36\
  18.  Çü─ éâ═ êëè \1\2\3\
  19. \37!\"#\37,-.\37?@[\37bcd\
  20. $%&'$/:;$\\]^$efg\
  21. ()*+(<=>(_`a(hij\
  22. ";
  23. //these characters are used in automatic frame lines intersection replacement
  24. //algorithm by mkline_aux3 and mkline3.
  25.  
  26. void mkline_aux4 (int cnt, int var, unsigned int mode, int pos, int color)
  27.     //auxiliary function for mkline3.
  28.  {
  29.     unsigned int c0;
  30.     unsigned int x,y;
  31.     char mult;
  32.     unsigned char c;
  33.     if ((mode&0x01)==0)
  34.      {
  35.         x=var;
  36.         y=cnt;
  37.         mult=0x01;
  38.      }
  39.      else
  40.      {
  41.         x=cnt;
  42.         y=var;
  43.         mult=0x10;
  44.      }
  45.     c=getcrtchar(x,y);
  46.     for (c0=0;c0<0x100 && c!=mkline_mat4[c0];c0++);
  47.     if(c0==0x100)
  48.         c0=0;
  49.     if (c0==0)
  50.         pos=3;
  51.     c0=(c0|(pos*mult));
  52.  
  53.     c0=(c0&(-12*mult-1));
  54.     if((mode&0x06)==2)
  55.         c0=(c0|(4*mult));
  56.     else if ((mode&0x06)==4)
  57.         c0=(c0|(8*mult));
  58.     else if ((mode&0x06)==6)
  59.         c0=(c0|(12*mult));
  60.  
  61.     printc(mkline_mat4[c0],x,y,color);
  62.  }
  63.  
  64. void mkline4 (int cnt, int bgn, int end, int color, unsigned int mode)
  65. //draws lines in menu boxes (text frames) with automatic character replacement
  66. //when another frame character is found at position where is going to be
  67. //printed the line.
  68.  {
  69.     unsigned c0;
  70.     mkline_aux4(cnt,bgn,mode,1,color);
  71.     bgn++;
  72.     for (c0=bgn;c0<end;c0++)
  73.         mkline_aux4(cnt,c0,mode,3,color);
  74.     mkline_aux4(cnt,end,mode,2,color);
  75.  }